package top.sqdpt.wechat.task;

import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import top.sqdpt.wechat.config.WxJavaConfig;

/**
 * @author pengtao
 * @date 2025/4/7
 * @Descciption
 **/
@Component
@Slf4j
public class MsgTask {

    @Autowired
    private WxMpService wxMpService;

    //"0/5 * *  * * ? "
    @Scheduled(cron = "${app.schedule.wx.sendMsgCron:0 0 8 * * ?}")
    public void sendMeg() {
    /*    WxMpTemplateMessage message = WxMpTemplateMessage
                .builder()
                //用户id
                .toUser()
                //模板id
                .templateId()
                .data()
                .build();
        try {
            wxMpService.getTemplateMsgService().sendTemplateMsg(message);
        } catch (Exception e) {
            log.error("发送微信模板消息失败", e);
        }*/
    }


}
